package com.chixing.day04_oop;

public class Account {
    private long accountId;
    private  String accountName;
    private String accountPassword;
    private long personIdNum;
    private long accountTelno;
    private double accountBalance;
    private String accType;

    public Account(long accountId,String accountName,
                   String accountPassword ,long personIdNum,
                   long accountTelno,double accountBalance,
                   String accType){
        this.accountId = accountId;
        this.accountName = accountName;
        this.accountPassword = accountPassword;
        this.personIdNum = personIdNum;
        this.accountTelno = accountTelno;
        this.accountBalance = accountBalance;
        this.accType = accType;
    }
    public void deposit(double money) {
        if (money > 0) {
            accountBalance += money;
            System.out.println(accountBalance);
        } else {
            System.out.println("存款失败");
        }
    }
    public void withdraw(double money) {
        if (money > 0 && money <= accountBalance) {
            accountBalance -= money;
            System.out.println(accountBalance);
        } else {
            System.out.println("取款失败");
        }
    }


}
